package io.renren.modules.sys.service.impl;

import java.util.Map;

import org.apache.commons.lang.StringUtils;
import org.springframework.stereotype.Service;

import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.plugins.Page;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;

import io.renren.common.utils.Constant;
import io.renren.common.utils.PageUtils;
import io.renren.common.utils.Query;
import io.renren.modules.sys.dao.ContainerDao;
import io.renren.modules.sys.entity.ContainerEntity;
import io.renren.modules.sys.entity.InfoManagerEntity;
import io.renren.modules.sys.service.ContainerService;


@Service("containerService")
public class ContainerServiceImpl extends ServiceImpl<ContainerDao, ContainerEntity> implements ContainerService {

    @Override
    public PageUtils queryPage(Map<String, Object> params) {
    	Integer onumber = Integer.valueOf(params.get("onumber").toString());
    	System.out.println("onumber="+onumber);
        Page<ContainerEntity> page = this.selectPage(
                new Query<ContainerEntity>(params).getPage(),
                new EntityWrapper<ContainerEntity>()
				.eq(onumber != null && onumber > 0, "onumber", onumber)
                .addFilterIfNeed(params.get(Constant.SQL_FILTER) != null, (String)params.get(Constant.SQL_FILTER))
        );

        return new PageUtils(page);
    }
}
